{include file="header"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card-header">
                <div class="left tbt">
                    <form action="{:url('search/work')}" method="get" class="layui-form layui-col-space5 hide">

                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" class="layui-input" name="keyword" value="{:request()->get('keyword')}" placeholder="作品名搜索">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" type="submit">搜索</button>
                        </div>
                    </form>
                </div>
                <div class="right">

                </div>
            </div>
            <div style="clear: both;"></div>
            <div class="layui-card-header tbt">
                {if $lists}
                以下搜索结果是<span class="x-red">{:request()->get('keyword')}</span>参与的作品，共<span class="x-red">{$lists->total()}</span>条记录
                {/if}
            </div>
            <div class="layui-card-body">
                <table class="layui-table layui-form">
                    <thead>
                    <tr>
                        <th>作品名</th>
                        <th>原作者</th>
                        <th>动画制作公司</th>
                        <th>漫画连载状态</th>
                        <th>TV更新状态</th>
                        <th>漫画首更年份</th>
                        <th>TV首更年份</th>
                    </tr>
                    </thead>
                    <tbody>

                    {volist name="lists" id="item"}
                    <tr>
                        <td>
                            <a href="javascript:;" onclick="add({$item.id})">
                                {$item.title} <br>
                                {$item.title_jp}
                            </a>

                        </td>
                        <td>
                            {$item.author} <br>
                            {$item.author_jp}
                        </td>
                        <td>
                            {volist name="$item.companys" id="val"}
                            {$val.title_cn}/{$val.title_jp} <br>
                            {/volist}
                        </td>
                        <td>
                            {if $item.comics_status eq 1}
                            连载中(目前{$item.comics_end_words}话)
                            {else}
                            已完结{if $item.comics_all}(全{$item.comics_all}话){/if}
                            {/if} </td>
                        <td>
                            {if $item.cartoon_status eq 1}
                            更新中(目前{$item.tv_end_words}话)
                            {else}
                            已完结{if $item.cartoon_all}(全{$item.cartoon_all}话){/if}
                            {/if}
                        </td>
                        <td> {$item.comics_start_time} </td>
                        <td> {$item.tv_start_time} </td>
                    </tr>
                    {/volist}

                    </tbody>
                </table>
            </div>
            <div class="layui-card-body ">
                {if $lists}
                {$lists|raw}
                {/if}
            </div>
        </div>
    </div>
</div>
<script>
    function add(id) {
        xadmin.open('作品详情','{:url("cartoon/details")}?search=1&id='+id,null,null,true,function () {
            window.location.reload();
        })
    }
</script>
{include file="footer"}